package ${packageName};

<#if imports??>
<#list imports as import>
import ${import};
</#list>
</#if>

/**
 * 由JSON自动生成的Java类
 * 原始JSON:
 * ${jsonString}
 */
public class ${className} {
    <#-- 字段定义 -->
    <#list fields as field>
    private ${field.type} ${field.name};
    </#list>

    <#-- 默认构造函数 -->
    public ${className}() {
    }

    <#-- Getter和Setter方法 -->
    <#list fields as field>
    public ${field.type} get${field.capitalizedName}() {
        return ${field.name};
    }

    public void set${field.capitalizedName}(${field.type} ${field.name}) {
        this.${field.name} = ${field.name};
    }
    </#list>

    @Override
    public String toString() {
        return "${className}{" +
            <#list fields as field>
            "${field.name}=" + ${field.name} + <#if field_has_next>", " + </#if>
            </#list>
            "}";
    }
}
